FROM php:8.2-cli-alpine3.18

# 安装所需的PHP扩展
RUN docker-php-ext-install pcntl

# 安装Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer \
    && composer --version

WORKDIR /app

# 使用Composer安装Workerman
COPY . /app
RUN composer require workerman/workerman

EXPOSE 1988

CMD ["php", "/app/server.php", "start"]
